package com.hafu.view;

import com.hafu.view.GYS.AddGYSFrm;
import com.hafu.view.GYS.ManageGYSFrm;
import com.hafu.view.ShangPin.AddShangPinFrm;
import com.hafu.view.ShangPin.ManageShangPinFrm;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.GroupLayout;

/**
 * @author 111
 */
public class MainFrm extends JFrame {
    public MainFrm() {
        initComponents();
    }

    private void GYSbutton1(ActionEvent e) {
        // TODO add your code here
        AddGYSFrm addGYSFrm=new AddGYSFrm();
        addGYSFrm.setVisible(true);
    }

    private void GYSbutton2(ActionEvent e) {
        // TODO add your code here
        ManageGYSFrm manageGYSFrm=new ManageGYSFrm();
        manageGYSFrm.setVisible(true);
    }

    private void button1(ActionEvent e) {
        // TODO add your code here
    }

    private void button2(ActionEvent e) {
        // TODO add your code here
    }

    private void SPbutton1(ActionEvent e) {
        // TODO add your code here
        AddShangPinFrm addShangPinFrm = new AddShangPinFrm();
        addShangPinFrm.setVisible(true);
    }

    private void SPbutton2(ActionEvent e) {
        // TODO add your code here
        ManageShangPinFrm manageShangPinFrm = new ManageShangPinFrm();
        manageShangPinFrm.setVisible(true);
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        button1 = new JButton();
        button2 = new JButton();
        button3 = new JButton();
        button4 = new JButton();

        //======== this ========
        Container contentPane = getContentPane();

        //---- button1 ----
        button1.setText("\u6dfb\u52a0\u4f9b\u5e94\u5546");
        button1.addActionListener(e -> GYSbutton1(e));

        //---- button2 ----
        button2.setText("\u7ba1\u7406\u4f9b\u5e94\u5546");
        button2.addActionListener(e -> GYSbutton2(e));

        //---- button3 ----
        button3.setText("\u6dfb\u52a0\u5546\u54c1");
        button3.addActionListener(e -> SPbutton1(e));

        //---- button4 ----
        button4.setText("\u5546\u54c1\u7ba1\u7406");
        button4.addActionListener(e -> SPbutton2(e));

        GroupLayout contentPaneLayout = new GroupLayout(contentPane);
        contentPane.setLayout(contentPaneLayout);
        contentPaneLayout.setHorizontalGroup(
            contentPaneLayout.createParallelGroup()
                .addGroup(contentPaneLayout.createSequentialGroup()
                    .addGap(73, 73, 73)
                    .addGroup(contentPaneLayout.createParallelGroup()
                        .addComponent(button3, GroupLayout.PREFERRED_SIZE, 90, GroupLayout.PREFERRED_SIZE)
                        .addComponent(button1))
                    .addGap(92, 92, 92)
                    .addGroup(contentPaneLayout.createParallelGroup()
                        .addComponent(button2)
                        .addComponent(button4, GroupLayout.PREFERRED_SIZE, 91, GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(185, Short.MAX_VALUE))
        );
        contentPaneLayout.setVerticalGroup(
            contentPaneLayout.createParallelGroup()
                .addGroup(contentPaneLayout.createSequentialGroup()
                    .addGroup(contentPaneLayout.createParallelGroup()
                        .addGroup(contentPaneLayout.createSequentialGroup()
                            .addGap(154, 154, 154)
                            .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(button3)
                                .addComponent(button4))
                            .addGap(30, 30, 30)
                            .addComponent(button1))
                        .addGroup(contentPaneLayout.createSequentialGroup()
                            .addGap(213, 213, 213)
                            .addComponent(button2)))
                    .addContainerGap(124, Short.MAX_VALUE))
        );
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private JButton button1;
    private JButton button2;
    private JButton button3;
    private JButton button4;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}